package courseClassStatistic;

import org.apache.hadoop.io.DoubleWritable;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.*;

import java.io.IOException;

public class mapper extends Mapper<LongWritable, Text, Text, DoubleWritable> {
    public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException{
           String line = value.toString();
           String str[] = line.split(",");
           for(String s: str){
               context.write(new Text(str[0] + str[2]), new DoubleWritable(Double.valueOf(str[4])));
           }
    }
}
